Repository navigation
fix(hooks): drop a rejected session start before the next turn - #45
Conversation
agent_turn_prepare awaited a session_start promise that stayed in the map after rejection, so every later turn in that session threw. Delete the entry before awaiting it, and do not rethrow from turn prepare. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 1, 2026, 6:12 AM ET / 10:12 UTC (Revision 2). ClawSweeper reviewWhat this changesBabelfish recovers turn preparation after failed session starts while preserving concurrent waits, replacement context, and lifecycle cleanup. Merge readiness✅ Ready for maintainer review This PR remains necessary: main and v0.1.0 retain the rejected session-start promise. The earlier README finding is resolved, and the pinned head has no actionable introduced defects. Likely related people: vincentkoc and RomneyDa are routing candidates from prior runtime work. Priority: P2 Review scores
Verification
How this fits togetherBabelfish translates imported plugin lifecycle hooks into OpenClaw callbacks. Session-start results supply context to later agent turns, while session end and reset release runtime resources. flowchart TD
A[OpenClaw lifecycle events] --> B[Imported session hooks]
B --> C[Hermes Python bridge]
B --> D[Session owner and pending start]
D --> E[Turn preparation]
E --> F[Agent context]
A --> G[End and reset cleanup]
G --> D
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Retain recovery after settled start failures and owner-guarded lifecycle cleanup without changing callback order or plugin decision policy. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the failure: a rejected session-start promise remains stored because main deletes it only after a successful await. The real-Python timeout fixture exercises that trigger; this read-only review did not execute it locally. Is this the best way to solve the issue? Yes, the patch narrowly repairs promise cleanup and replacement ownership while preserving the existing callback sequence, with focused lifecycle coverage and compatibility documentation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e03fb18d70e1. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
@clawsweeper re-review Please review exact head |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Please review exact head |
|
🦞👀 Re-review progress:
|
Summary
start without deleting its entry. Prevent late completion from restoring ended
or replaced session context. A persistent owner token prevents older end/reset
cleanup from removing a replacement, including after its context is consumed.
enqueue. No callback relocation, public API change, or new lifecycle subsystem.
Compatibility
turns; session end/reset and distinct sessions remain isolated.
Verification
Exact head:
60b6196ff70398ea5cce37d07e32983857312998, based one03fb18d70e110826287f7933b976bc7f7bfb6f5.npm run check: 193 tests passed in 12 files.npm run pack:check: 24 files, 290021 unpacked bytes.All fixtures use isolated temporary state.
Merge is held at the ClawSweeper gate. Its supported
exact-item review run
failed admission with
queue does not advertise enabled manual record/comment-only publication.The existing verdict belongs to the original head and is not reused as clearance.
The ClawSweeper operator must restore that capability and rerun the failed review,
or a genuine automatic review must publish a verdict for this exact head.